﻿using normalize = KeyWordSearch.Normalization;

namespace KeyWordSearch.ProcessTree
{
	internal sealed class RootNode:NonTerminalNode
	{
		public RootNode()
			: base(null)
		{
		}


		
		public override ExecuteResult Execute(normalize::LiveProgramNormalizationResult inspectionTarget)
		{
			if (base.Childes.Count != 1)
			{
				throw new ProcessInconsistencyException("Rootに二つ以上の子ノードが存在します。");
			}

			base.Childes.Reset();
			base.Childes.Next();
			return base.Childes.Current.Execute(inspectionTarget);
		}
	}


}
